home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / vbhelp.exe / HELPF.FRM < prev    next >
Text File  |  1993-02-09  |  25KB  |  698 lines

  1. Version 1.00
  2. BEGIN Form frmHelpMain
  3.     AutoRedraw   = -1
  4.     BackColor    = QBColor(7)
  5.     BorderStyle  = 2
  6.     Caption      = "Help"
  7.     ControlBox   = -1
  8.     Enabled      = -1
  9.     ForeColor    = QBColor(0)
  10.     Height       = Char(19)
  11.     Left         = Char(7)
  12.     MaxButton    = -1
  13.     MinButton    = -1
  14.     MousePointer = 0
  15.     Tag          = ""
  16.     Top          = Char(2)
  17.     Visible      = -1
  18.     Width        = Char(66)
  19.     WindowState  = 0
  20.     BEGIN HScrollBar hscHelp
  21.         Attached     = -1
  22.         DragMode     = 0
  23.         Enabled      = -1
  24.         Height       = Char(1)
  25.         LargeChange  = 20
  26.         Left         = Char(8)
  27.         Max          = 32767
  28.         Min          = 1
  29.         MousePointer = 0
  30.         SmallChange  = 1
  31.         TabIndex     = 6
  32.         TabStop      = 0
  33.         Tag          = ""
  34.         Top          = Char(20)
  35.         Value        = 1
  36.         Visible      = -1
  37.         Width        = Char(63)
  38.     END
  39.     BEGIN VScrollBar vscHelp
  40.         Attached     = -1
  41.         DragMode     = 0
  42.         Enabled      = -1
  43.         Height       = Char(16)
  44.         LargeChange  = 1
  45.         Left         = Char(72)
  46.         Max          = 32767
  47.         Min          = 1
  48.         MousePointer = 0
  49.         SmallChange  = 1
  50.         TabIndex     = 7
  51.         TabStop      = 0
  52.         Tag          = ""
  53.         Top          = Char(3)
  54.         Value        = 1
  55.         Visible      = -1
  56.         Width        = Char(1)
  57.     END
  58.     BEGIN PictureBox pctBackground
  59.         AutoRedraw   = -1
  60.         BackColor    = QBColor(7)
  61.         BorderStyle  = 0
  62.         DragMode     = 0
  63.         Enabled      = -1
  64.         ForeColor    = QBColor(0)
  65.         Height       = Char(14)
  66.         Left         = Char(0)
  67.         MousePointer = 0
  68.         TabIndex     = 0
  69.         TabStop      = -1
  70.         Tag          = ""
  71.         Top          = Char(3)
  72.         Visible      = -1
  73.         Width        = Char(64)
  74.     END
  75.     BEGIN CommandButton cmdButtonBar
  76.         BackColor    = QBColor(7)
  77.         Cancel       = 0
  78.         Caption      = "&Contents"
  79.         Default      = 0
  80.         DragMode     = 0
  81.         Enabled      = 0
  82.         Height       = Char(3)
  83.         Index        = 0
  84.         Left         = Char(0)
  85.         MousePointer = 0
  86.         TabIndex     = 1
  87.         TabStop      = 0
  88.         Tag          = ""
  89.         Top          = Char(0)
  90.         Visible      = -1
  91.         Width        = Char(12)
  92.     END
  93.     BEGIN CommandButton cmdButtonBar
  94.         BackColor    = QBColor(7)
  95.         Cancel       = 0
  96.         Caption      = "&Search..."
  97.         Default      = 0
  98.         DragMode     = 0
  99.         Enabled      = 0
  100.         Height       = Char(3)
  101.         Index        = 1
  102.         Left         = Char(13)
  103.         MousePointer = 0
  104.         TabIndex     = 2
  105.         TabStop      = 0
  106.         Tag          = ""
  107.         Top          = Char(0)
  108.         Visible      = -1
  109.         Width        = Char(12)
  110.     END
  111.     BEGIN CommandButton cmdButtonBar
  112.         BackColor    = QBColor(7)
  113.         Cancel       = 0
  114.         Caption      = "&Back"
  115.         Default      = 0
  116.         DragMode     = 0
  117.         Enabled      = 0
  118.         Height       = Char(3)
  119.         Index        = 2
  120.         Left         = Char(26)
  121.         MousePointer = 0
  122.         TabIndex     = 3
  123.         TabStop      = 0
  124.         Tag          = ""
  125.         Top          = Char(0)
  126.         Visible      = -1
  127.         Width        = Char(12)
  128.     END
  129.     BEGIN CommandButton cmdButtonBar
  130.         BackColor    = QBColor(7)
  131.         Cancel       = 0
  132.         Caption      = "His&tory..."
  133.         Default      = 0
  134.         DragMode     = 0
  135.         Enabled      = 0
  136.         Height       = Char(3)
  137.         Index        = 3
  138.         Left         = Char(39)
  139.         MousePointer = 0
  140.         TabIndex     = 4
  141.         TabStop      = 0
  142.         Tag          = ""
  143.         Top          = Char(0)
  144.         Visible      = -1
  145.         Width        = Char(12)
  146.     END
  147.     BEGIN CommandButton cmdButtonBar
  148.         BackColor    = QBColor(7)
  149.         Cancel       = 0
  150.         Caption      = "Co&py..."
  151.         Default      = 0
  152.         DragMode     = 0
  153.         Enabled      = -1
  154.         Height       = Char(3)
  155.         Index        = 4
  156.         Left         = Char(52)
  157.         MousePointer = 0
  158.         TabIndex     = 5
  159.         TabStop      = 0
  160.         Tag          = ""
  161.         Top          = Char(0)
  162.         Visible      = -1
  163.         Width        = Char(12)
  164.     END
  165. END
  166. ' ------------------------------------------------------------------------
  167. ' Visual Basic for MS-DOS Help Toolkit
  168. '
  169. ' Help Window Form
  170. '
  171. ' The Help Toolkit (HELP.BAS, HELPF.FRM, and HELPUTIL.FRM)
  172. ' makes it easy to add a hypertext Help system to your
  173. ' applications.
  174. '
  175. ' To use the Help Toolkit in your programs, include
  176. ' HELP.BAS, HELPF.FRM, and HELPUTIL.FRM in your program or
  177. ' use the supplied library (HELP.LIB, HELPA.LIB - AltMath
  178. ' version) and Quick library (HELP.QLB) and call the
  179. ' appropriate routines to load and display your help topics.
  180. ' Forms and code modules that call Help routines
  181. ' must include HELP.BI ('$INCLUDE: 'HELP.BI').'
  182. '
  183. ' Refer to the module level comments in HELP.BAS for
  184. ' more information on using the Help Toolkit.
  185. '
  186. ' Copyright (C) 1982-1992 Microsoft Corporation
  187. '
  188. ' You have a royalty-free right to use, modify, reproduce
  189. ' and distribute the sample applications and toolkits provided with
  190. ' Visual Basic for MS-DOS (and/or any modified version)
  191. ' in any way you find useful, provided that you agree that
  192. ' Microsoft has no warranty, obligations or liability for
  193. ' any of the sample applications or toolkits.
  194. ' ------------------------------------------------------------------------
  195.  
  196. ' Include file containing procedure declarations.
  197. '$INCLUDE: 'HELP.BI'
  198.  
  199. '$FORM frmHelpUtils         ' Form for Search, History, and Change dialogs
  200.  
  201. TYPE IndexType              ' Used to index Help topics
  202.     StartFilePtr AS LONG    ' Position within the topic's file
  203.     NumLines AS INTEGER     ' Number of lines in the Help topic
  204. END TYPE
  205.  
  206. TYPE PointType
  207.     X AS INTEGER            ' Horizontal location
  208.     Y AS INTEGER            ' Vertical location
  209. END TYPE
  210.  
  211. ' Variables common to HELP.BAS, HELPF.FRM, and HELPUTIL.FRM.
  212. COMMON SHARED /HelpLib/ DialogBackcolor AS INTEGER ' Background color for Help dialog boxes (Search, Copy, History)
  213. COMMON SHARED /HelpLib/ DialogForecolor AS INTEGER ' Foreground color for Help dialog boxes (Search, Copy, History)
  214.  
  215. ' Variables common to HELP.BAS and HELPF.FRM.
  216. COMMON SHARED /HelpLib/ Topic() AS STRING ' Lines of the current Help topic
  217. COMMON SHARED /HelpLib/ LeftChar AS INTEGER ' Leftmost character of the Help topic given the horizonal scroll position
  218. COMMON SHARED /HelpLib/ StartLine AS INTEGER ' Top line of the Help topic given the vertical scroll position
  219. COMMON SHARED /HelpLib/ MaxLineLen AS INTEGER ' Longest line of the Help topic
  220. COMMON SHARED /HelpLib/ HelpIndexPtr() AS IndexType ' Table that stores data about each Help topic
  221. COMMON SHARED /HelpLib/ HelpIndexTopics() AS STRING ' Array of Help topic names.  Used with the HelpIndexPtr table.
  222. COMMON SHARED /HelpLib/ HelpFileNum AS INTEGER ' Logical file number assigned to the Help file by HelpRegister
  223. COMMON SHARED /HelpLib/ HelpTopicStack()  AS STRING ' Array of the last 20 Help topics shown
  224. COMMON SHARED /HelpLib/ HelpTopicStackPtr  AS INTEGER ' Number of topics in the HelpTopicStack
  225. COMMON SHARED /HelpLib/ TopicFound AS STRING ' The Help topic being shown
  226. COMMON SHARED /HelpLib/ MaxHistoryStack AS INTEGER ' Maximum allowed size of the HelpTopicStack.  HelpRegister sets to 20.
  227. COMMON SHARED /HelpLib/ UnloadOnClose AS INTEGER ' Flag that determines if closing the Help form terminates the Help system.
  228. COMMON SHARED /HelpLib/ KillHelp AS INTEGER ' Flag that HelpClose sets to terminate the Help form
  229. COMMON SHARED /HelpLib/ CursorPos AS PointType ' Position of the currently selected Help link within a topic
  230. COMMON SHARED /HelpLib/ ButtonBarHeight AS INTEGER ' Number of lines to reserve at the top of the form for the button bar.  0 or 3.
  231. COMMON SHARED /HelpLib/ CloseOnEscape AS INTEGER ' If TRUE, pressing ESC will close the Help window
  232.  
  233. DEFINT A-Z
  234.  
  235. CONST StartChar = ""
  236. CONST EndChar = ""
  237. CONST FALSE = 0
  238. CONST TRUE = NOT FALSE
  239.  
  240. '  Click event procedure for the button bar command buttons (control array)..
  241. '  Invokes appropriate action when user clicks one of the buttons.
  242. SUB cmdButtonBar_Click (index AS INTEGER)
  243.     SELECT CASE index
  244.         CASE 0 ' Contents button
  245.             pctBackground.SETFOCUS
  246.             HelpShowTopic "Contents"
  247.         CASE 1 ' Search button
  248.             HelpSearch
  249.         CASE 2 ' Back button
  250.             HelpTopicStackPtr = HelpTopicStackPtr - 2
  251.             pctBackground.SETFOCUS
  252.             HelpShowTopic HelpTopicStack(HelpTopicStackPtr + 1)
  253.         CASE 3 ' History button
  254.             FOR i = HelpTopicStackPtr TO 1 STEP -1
  255.                 frmHelpUtil